package com.zprmb.udzt.activity;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

import com.zprmb.udzt.R;

public class InvestLoginDialog extends Dialog {
	private OnSureClickListener mListener;
	  private Button button_sure;
	    private Button button_cancel;

	    private TextView content;
	    private InvestLoginDialog dialog;
	    private String type="";
	    private Context context; // 上下文对象
	public InvestLoginDialog(Context context) {
		super(context);
		// TODO Auto-generated constructor stub
	}
	public InvestLoginDialog(Context context , OnSureClickListener Listener) {
		super(context);
	mListener=Listener;
		// TODO Auto-generated constructor stub
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		

			// No Titlebar
			this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.v6_invest_login);
		
		setView();
	}
	public void setText(String text){
		content.setText(text);
	}

	public void setButtonCancel(String text){
		button_cancel.setText(text);
	}
	public void setButtonsure(String text){
		button_sure.setText(text);
	}
	public void setType(String text){
		type=text;
	}
	public String getType(){
		return type;
	}
	private  void setView()  
	{  
	    button_sure = (Button) findViewById(R.id.button_sure);  
	    button_cancel = (Button) findViewById(R.id.button_cancel);  

	    content=(TextView)findViewById(R.id.alert_text);

	//这里的监听事件，因为该类继承lDialog类的DialogInterface,而DialogInterface中也有OnClickListener，因此需要用到全名View.OnClickListener  
	        button_sure.setOnClickListener(new View.OnClickListener()   
	        {  
	            public void onClick(View v)  
	            {  
	               mListener.onConfirm2();
	                dismiss();  
	            }  
	        });  
	        button_cancel.setOnClickListener(new View.OnClickListener()  
	        {  
	            public void onClick(View v)  
	            {  
	                 mListener.onCancle();
	                dismiss();  
	            }  
	        });  
	    }  
	
	public interface OnSureClickListener{
		void onConfirm2();
		void onCancle();
	}
   
}
